﻿using System;
using System.Linq;
using System.Linq.Dynamic;
using System.Web.Mvc;
using ChoViet.CMS.Properties;
using ChoViet.CMS.ViewModels;
using ChoViet.Lib.Common;
using ChoViet.Lib.Paging;
using ChoViet.Model;

namespace ChoViet.CMS.Controllers
{
    public class SubjectController : BaseController
    {
        ChoVietDataContext eDataContext = new ChoVietDataContext();

        #region CMS: Comments
        //public ActionResult Index(int id, int? page)
        //{
        //    try
        //    {
        //        if (!page.HasValue) page = 1;
        //        int pageSize = int.Parse(UserState.getUserStateFromRequest("Comment.pageSize", "PageSize", 20).ToString());
        //        var param = new SubjectViewModels();
        //        param.Articles = eDataContext.Articles.Where(e => e. == id).Select(e => e.Ad)
        //                        .OrderByDescending(e =>e.ModifyDate)
        //                        .ToPagedList(page.Value - 1, pageSize);
        //        param.Tag = eDataContext.Tags.FirstOrDefault(e => e.ID == id);

        //        return View(param);
        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //}

        public ActionResult DetailsCms(int id)
        {
            var param = eDataContext.Comments.FirstOrDefault(e => e.ID == id);
            return View(param);
        }
        #endregion
    }
}
